package com.dpiinc.TechPage.widget

import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction

/**
 * TODO name
 * Created by X on 2018/7/4.
 */
open class BaseDialogFragment : DialogFragment() {
    override fun show(manager: FragmentManager, tag: String?) {
        try {
            super.show(manager, tag)
        } catch (e: Exception) {
            // 捕获 FragmentTransaction.commit()可能出现的异常
        }
    }

    override fun show(transaction: FragmentTransaction, tag: String?): Int {
        var result = -1
        try {
            result = super.show(transaction, tag)
        } catch (e: Exception) {
            // 捕获 FragmentTransaction.commit()可能出现的异常
        }

        return result
    }

    override fun dismiss() {
        super.dismissAllowingStateLoss()
    }
}